<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>面试报告 - AI面试官</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdn.jsdelivr.net/npm/boxicons@2.0.7/css/boxicons.min.css" rel="stylesheet">
    <style>
        :root {
            --primary-color: #4a90e2;
            --secondary-color: #f8f9fa;
            --text-primary: #2c3e50;
            --text-secondary: #6c757d;
            --success-color: #28a745;
            --warning-color: #ffc107;
            --danger-color: #dc3545;
            --border-radius: 12px;
            --transition: all 0.3s ease;
        }

        body {
            background-color: #f4f6f9;
            font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
            padding: 30px;
        }

        .report-container {
            max-width: 1200px;
            margin: 0 auto;
        }

        .report-header {
            background: white;
            padding: 30px;
            border-radius: var(--border-radius);
            box-shadow: 0 2px 12px rgba(0,0,0,0.08);
            margin-bottom: 30px;
        }

        .report-title {
            color: var(--text-primary);
            font-size: 2rem;
            margin-bottom: 20px;
            display: flex;
            align-items: center;
            gap: 15px;
        }

        .report-title i {
            color: var(--primary-color);
        }

        .candidate-info {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 20px;
            margin-bottom: 20px;
        }

        .info-item {
            padding: 15px;
            background: var(--secondary-color);
            border-radius: 8px;
        }

        .info-label {
            color: var(--text-secondary);
            font-size: 0.9rem;
            margin-bottom: 5px;
        }

        .info-value {
            color: var(--text-primary);
            font-size: 1.1rem;
            font-weight: 600;
        }

        .evaluation-section {
            background: white;
            padding: 30px;
            border-radius: var(--border-radius);
            box-shadow: 0 2px 12px rgba(0,0,0,0.08);
            margin-bottom: 30px;
        }

        .section-title {
            color: var(--text-primary);
            font-size: 1.5rem;
            margin-bottom: 20px;
            padding-bottom: 10px;
            border-bottom: 2px solid var(--secondary-color);
        }

        .dimension-card {
            background: var(--secondary-color);
            padding: 20px;
            border-radius: 8px;
            margin-bottom: 20px;
        }

        .dimension-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 15px;
        }

        .dimension-name {
            font-size: 1.2rem;
            font-weight: 600;
            color: var(--text-primary);
        }

        .dimension-score {
            font-size: 1.4rem;
            font-weight: bold;
            color: var(--primary-color);
        }

        .dimension-reason {
            color: var(--text-secondary);
            line-height: 1.6;
        }

        .chat-history {
            background: white;
            padding: 30px;
            border-radius: var(--border-radius);
            box-shadow: 0 2px 12px rgba(0,0,0,0.08);
        }

        .chat-message {
            display: flex;
            margin-bottom: 25px;
            max-width: 80%;
            align-items: flex-start;
        }

        .chat-message.assistant {
            margin-right: auto;
        }

        .chat-message.user {
            margin-left: auto;
            flex-direction: row-reverse;
        }

        .avatar {
            width: 48px;
            height: 48px;
            border-radius: 50%;
            margin: 0 15px;
            flex-shrink: 0;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }

        .avatar.assistant {
            background-color: #a0e759;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 15px;
            font-weight: bold;
        }

        .avatar.user {
            background-color: #4a90e2;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 15px;
            font-weight: bold;
        }

        .message-bubble {
            padding: 12px 16px;
            border-radius: 12px;
            position: relative;
            word-wrap: break-word;
            max-width: calc(100% - 100px);
            box-shadow: 0 1px 2px rgba(0,0,0,0.1);
        }

        .assistant .message-bubble {
            background-color: #f0f0f0;
            border-top-left-radius: 4px;
        }

        .user .message-bubble {
            background-color: #95ec69;
            border-top-right-radius: 4px;
        }

        .message-content {
            color: var(--text-primary);
            line-height: 1.6;
            font-size: 15px;
        }

        .overall-score {
            font-size: 3rem;
            font-weight: bold;
            color: var(--primary-color);
            text-align: center;
            margin: 20px 0;
        }

        .back-button {
            display: inline-flex;
            align-items: center;
            gap: 10px;
            padding: 10px 20px;
            background: var(--primary-color);
            color: white;
            border-radius: var(--border-radius);
            text-decoration: none;
            margin-bottom: 20px;
            transition: var(--transition);
        }

        .back-button:hover {
            background: #357abd;
            color: white;
        }
    </style>
</head>
<body>
    <div class="report-container">
        <a href="javascript:history.back()" class="back-button">
            <i class='bx bx-arrow-back'></i>
            返回
        </a>

        <div class="report-header">
            <h1 class="report-title">
                <i class='bx bx-file'></i>
                面试报告
            </h1>
            <div class="candidate-info">
                <div class="info-item">
                    <div class="info-label">候选人</div>
                    <div class="info-value">{{ report.application.candidate_name }}</div>
                </div>
                <div class="info-item">
                    <div class="info-label">应聘职位</div>
                    <div class="info-value">{{ report.application.job_title }}</div>
                </div>
                <div class="info-item">
                    <div class="info-label">面试时间</div>
                    <div class="info-value">{{ report.start_time.strftime('%Y-%m-%d %H:%M') }}</div>
                </div>
                <div class="info-item">
                    <div class="info-label">面试时长</div>
                    <div class="info-value">
                        {% set duration = (report.end_time - report.start_time).total_seconds() // 60 %}
                        {{ duration }} 分钟
                    </div>
                </div>
            </div>
            <div class="overall-score">
                {{ "%.1f"|format(report.overall_score) }} 分
            </div>
        </div>

        <div class="evaluation-section">
            <h2 class="section-title">评估维度</h2>
            {% for item in report.evaluation.evaluation_details %}
            <div class="dimension-card">
                <div class="dimension-header">
                    <span class="dimension-name">{{ "专业能力" if item.dimension == "技术能力" else item.dimension }}</span>
                    <span class="dimension-score">{{ item.score }}分</span>
                </div>
                <p class="dimension-reason">{{ item.reason }}</p>
            </div>
            {% endfor %}
        </div>

        <div class="chat-history">
            <h2 class="section-title">面试对话记录</h2>
            {% if report.history %}
                {% for message in report.history %}
                    {% if loop.index0 % 2 == 0 %}
                    <div class="chat-message assistant">
                        <div class="avatar assistant">面试官</div>
                        <div class="message-bubble">
                            <div class="message-content">{{ message }}</div>
                        </div>
                    </div>
                    {% else %}
                    <div class="chat-message user">
                        <div class="avatar user">{{ report.application.candidate_name }}</div>
                        <div class="message-bubble">
                            <div class="message-content">{{ message }}</div>
                        </div>
                    </div>
                    {% endif %}
                {% endfor %}
            {% else %}
                <p class="text-center text-muted">暂无对话记录</p>
            {% endif %}
        </div>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html> 